﻿using Sirenix.OdinInspector.Editor;
using UnityEditor;
using Sirenix.Utilities.Editor;
using Sirenix.Utilities;
using YFrameWork.RunTime;

namespace YFrameWork.Editor
{

    /// <summary>
    /// 改变资源中的字体
    /// </summary>
    public class ToolsEditorWindows : OdinMenuEditorWindow
    {
        [MenuItem("YGF/Tools")]
        private static void OpenWindow()
        {
            var window = GetWindow<ToolsEditorWindows>();
            window.position = GUIHelper.GetEditorWindowRect().AlignCenter(800, 600);
        }

        protected override OdinMenuTree BuildMenuTree()
        {
            var tree = new OdinMenuTree(true);
            tree.DefaultMenuStyle.IconSize = 28.00f;
            tree.Config.DrawSearchToolbar = true;

            // Adds the character overview table.
            ChangeOverview.Instance.UpdateCharacterOverview();
            tree.Add("改变资源字体", new ChangeFontTable(ChangeOverview.Instance.mChangeFontObject));

            tree.Add("流程类控制", ChangeOverview.Instance.mAssetsDataProcedure);

            // Add all scriptable object items.
            //tree.AddAllAssetsAtPath("", "Assets/Plugins/Sirenix/Demos/SAMPLE - RPG Editor/Items", typeof(Item), true)
            //    .ForEach(this.AddDragHandles);

            // Add drag handles to items, so they can be easily dragged into the inventory if characters etc...
            tree.EnumerateTree();

            // Add icons to characters and items.
            //tree.EnumerateTree().AddIcons<GoList>(x => x.Font);
            //tree.EnumerateTree().AddIcons<Item>(x => x.Icon);


            return tree;
        }

  


       
       
   
    }


}